package org.example.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.bean.School;
import org.example.service.SchoolService;
import org.example.util.JsonResult;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther:Liu
 * @Testname:SchoolController
 * @Date:2025/9/9 13:26
 */
@RestController
@RequestMapping("/school")
@Slf4j
public class SchoolController {
    @Resource
    private SchoolService schoolService;

    @PostMapping("/saveSchool")
    JsonResult SaveSchool(School school) {
        return schoolService.SaveSchool(school);
    }
    int i=0;
    @GetMapping("/find_id/{id}")
    JsonResult findById(@PathVariable("id")String id) {
        log.info("find_id:{}", i);
        i++;
        return schoolService.findById(id);
    }
}
